<!DOCTYPE html>
<html lang="" style="height: 100%;">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1.0">


</head>
<body style="height: 100%;">
<style>
div:target {
    background-color: yellow;
}
</style>
<!-- 创建一个带有id的元素 -->
<div id="section1">这是第一部分。</div>
<div id="section2">这是第二部分。</div>
<div id="section3">这是第三部分。</div>

<!-- 创建到锚点的链接 -->
<a href="#section1">跳转到第一部分</a>
<a href="#section2">跳转到第二部分</a>
<a href="#section3">跳转到第三部分</a>


<script>
    async function test() {
        console.log('before await------------')
        let res = await new Promise(( resolve, reject) => {
            setTimeout(() => {
                resolve('success')
            }, 5000)
        })
        console.log('after await------------')
        return res
    }
    let p = test()
    p.then(res=>{
        console.log(res)
    })
    console.log('this is p ------------------------------'+p)
    console.log('test over ------------------------------')

    let user = {
        username: 'admin',
        children: [
            {
                name: '首页',
                path: '/home',
                icon: 'el-icon-s-home',
                children: []
            },
            {
                name: '商品管理',
                path: '/goods',
                icon: 'el-icon-s-goods',
                children: [
                    {
                        name: '商品列表',
                        path: '/goods/list',
                        icon: 'el-icon-s-order',
                        children: []
                    }
                ]
            }
        ]
    }

    let user1 = {...user}
    console.log(user1)
    user.children[0].name = 'dfdf'
    console.log('===='+user1.children[0].name)


    console.log('ssdsds')

    function login() {
        console.log('login')
    }

    let o = {
        login() {
            console.log('o.login')
            login()
        }
    }
    o.login()

    console.log('sssssssssssssssssssssssssssssssssssssssssss')
    let pathTmp = '/aa/bb/cc'
    let pathTmp2 = pathTmp.substring(1)
    console.log(pathTmp)
    console.log(pathTmp2)
</script>


</body>
</html>
